<template>
  <div v-popover:developer class="icon">
    <span class="developerMode"> {{className}} </span>
    <i class="el-icon-arrow-down" :class="visible ? 'rotate180' : ''" v-if="this.classList.length > 1"></i>
    <!-- <span style="line-height: 56px">
      <i class="fks-icon-developerMode" />
    </span> -->
    <el-popover
      ref="developer"
      trigger="click"
       v-model="visible"
      placement="bottom"
      :visible-arrow="false"
       v-if="this.classList.length > 1"
    >
      <div class="developer-select">
        <ul class="developer-select-options">
          <li
            v-for="mode in mode"
            :key="mode.value"
            @click="handleCommand(mode)"
          >
            <span>{{ mode.label }}</span>
          </li>
        </ul>
      </div>
    </el-popover>
  </div>
</template>
<script>
// import { getClientCatch, getUserCatch, getUserPermission } from '@/api/app'
export default {
  data() {
    return {
      data: {
      },
      visible: false,
   className:'',
   classList:[]
    }
  },
  computed: {
    mode() {
      return [
        { value: 'SyncUserCache', label: '1' },
        { value: 'SyncUserPermission', label: '2' },
        { value: 'SyncClientCache', label: '3' },
        { value: 'close', label: '4' }
      ]
    }
  },
  methods: {
    handleCommand(data) {
      this.visible=false
    }
  }
}
</script>

<style lang="scss" scoped>
.rotate180 {
  transform: rotate(180deg);
}
.developerMode {
  width: 1em;
  height: 1em;
  margin: 0 auto;
  font-size: 14px;
  color: #999;
  cursor: pointer;
}

.icon {
  height: 100%;
  flex-shrink: 0;
  // width: 36px;
  padding: 0 10px;
  text-align: center;
  cursor: pointer;

  &:hover {
    background: rgba(0, 0, 0, 0.05);
    cursor: pointer;
  }
}

.developer-select {
  &-title {
    padding: 0 0 8px;
    border-bottom: 1px solid #f2f3f4;
    font-weight: bold;
    text-align: center;
    color: #393e45;
  }

  &-options {
    padding: 8px 0 0;

    li {
      padding: 4px 0;
      font-size: 0;
      text-align: center;
      cursor: pointer;

      &:hover {
        background-color: #f7f8f8;
      }
    }

    li + li {
      margin-top: 4px;
    }

    span {
      font-size: 14px;
      vertical-align: middle;
      color: #999;
    }
  }
}
</style>
